package com.siyu.single.v1;

/**
 * @Author: siyu
 * @CreateTime: 2024-10-06
 * @Version: 1.0
 */
public class Test {

    public static void main(String[] args) {

        // SingleObject singleObject = new SingleObject();  创建不了，private

        //获取唯一可用的对象
        SingleObject object1 = SingleObject.getInstance();
        SingleObject object2 = SingleObject.getInstance();

        System.out.println(object1.hashCode() == object2.hashCode());

    }
}
